package com.custom.common.sha256;

import javax.servlet.http.HttpServletResponse;
import java.io.IOException;

/**
 * @ClassName: ResponseHelper
 * @description:
 * @author: liukui
 * @date: 2018/11/17 16:06
 * @version: 1.0
 */
public class ResponseHelper {
    public ResponseHelper() {
    }

    public static void setCode403(HttpServletResponse response) throws IOException {
        response.setCharacterEncoding("UTF-8");
        response.setHeader("content-type", "text/html;charset=UTF-8");
        response.getWriter().println("{code:403, msg:'请求校验失败'}");
        response.setStatus(403);
    }

    public static void setCode405(HttpServletResponse response) throws IOException {
        response.setCharacterEncoding("UTF-8");
        response.setHeader("content-type", "text/html;charset=UTF-8");
        response.getWriter().println("{code:405, msg:'请求校验失败'}");
        response.setStatus(405);
    }
}
